package com.jltx.xq.coroutinesandrxpro

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.jltx.xq.coroutinesandrxpro.coroutines.CoroutinesLearn3
import com.jltx.xq.coroutinesandrxpro.rxjava.RxJava2Learn3

class MainActivity3 : AppCompatActivity(), View.OnClickListener {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main3)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.rx_learn3_1 ->
                RxJava2Learn3.customIntervalSub()
            R.id.rx_learn3_2 ->
                RxJava2Learn3.publishSubjectInterval()
            R.id.cor_learn3_1 ->
                CoroutinesLearn3.customChannelInterval()
            R.id.cor_learn3_2 ->
                CoroutinesLearn3.customBufferChannelInterval()
            R.id.cor_learn3_3 ->
                CoroutinesLearn3.customProduceChannelInterval()
            R.id.cor_learn3_4 ->
                CoroutinesLearn3.customActorChannelInterval()
            R.id.cor_learn3_5 ->
                CoroutinesLearn3.customMultiReceiveChannelInterval()
            R.id.cor_learn3_6 ->
                CoroutinesLearn3.customChannelClose()
            R.id.cor_learn3_7 ->
                CoroutinesLearn3.broadcastChannelInterval()

        }
    }
}